package com.dollar.juc.lock;

public class Counter {
    long cnt = 0;
    SpinLock lock = new SpinLock();

    public void add10000(){
        lock.lock();
        try{
            for (int i = 0; i < 100000; i++) {
                cnt++;
            }
        }finally {
            lock.unlock();
        }
    }
}
